//
//  Person.h
//  06集合遍历和数组排序HomeWork
//
//  Created by dllo on 16/7/8.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Person : NSObject
@property(nonatomic,retain)NSString *name;
@property(nonatomic,assign)NSInteger age;
@property(nonatomic,retain)NSString *sex;

- (instancetype)initWithName:(NSString *)name
                         age:(NSInteger)age
                         sex:(NSString *)sex;
+ (instancetype)personWithName:(NSString *)name
                           age:(NSInteger)age
                           sex:(NSString *)sex;

- (NSComparisonResult)compareByName:(Person *)anotherPerson;
- (NSComparisonResult)compareByAge:(Person *)anotherPerson;
- (NSComparisonResult)compareBySex:(Person *)anotherPerson;
@end
